import React from 'react';
import { createBrowserRouter, RouterProvider } from 'react-router-dom'
import SplashScreen from '../pages/SplashScreen'
import HomePage from '../pages/HomePage'
import HospitalListPage from '../pages/HospitalListPage'
import HospitalDetailPage from '../pages/HospitalDetailPage'
import DoctorListPage from '../pages/DoctorListPage'
import DoctorDetailPage from '../pages/DoctorDetailPage'
import BookingPage from '../pages/BookingPage'
import BookingPatientPage from '../pages/BookingPatientPage'
import ConfirmOrderPage from '../pages/ConfirmOrderPage'
import PaymentSuccessPage from '../pages/PaymentSuccessPage';
import MyAppointmentsPage from '../pages/MyAppointmentsPage';
import ProfilePage from '../pages/ProfilePage';
import AddPatientPage from '../pages/AddPatientPage';

// 主页面（临时）
const Home = () => {
  <div style={{
    padding: '20px',
    textAlign: 'center',
    height: '100vh',
    display: 'flex',
    flexDirection: 'column',
    justifyContent: 'center',
    alignItems: 'center',
    background: '#f5f5f5'
  }}>
    <h1 style={{ marginBottom: '20px' }}>欢迎来到首页</h1>
    <p>这是应用的主页面</p>
  </div>
}

const router = createBrowserRouter([
  {
    path: '/',
    element: <SplashScreen />,
  },
  {
    path: '/home',
    element: <HomePage />
  },
  {
    path: '/hospital-list',
    element: <HospitalListPage />
  },
  {
    path: '/hospital/:id',
    element: <HospitalDetailPage />
  },
  {
    path: '/coctors/:department',
    element: <DoctorListPage />
  },
  {
    path: '/doctor/:id',
    element: <DoctorDetailPage />
  },
  {
    path: '/booking/:doctorId',
    element: <BookingPage />
  },
  {
    path: '/booking/patient/:doctorId',
    element: <BookingPatientPage />
  },
  {
    path: '/my-appointments',
    element: <MyAppointmentsPage />
  },
  {
    path: '/confirm-order',
    element: <ConfirmOrderPage />
  },
  {
    path: '/payment-success',
    element: <PaymentSuccessPage />
  },
  {
    path: '/profile',
    element: <ProfilePage />
  },
  {
    path: '/add-patient',
    element: <AddPatientPage />
  }
])

const AppRouter: React.FC = () => {
  return <RouterProvider router={router} />
}

export default AppRouter;